import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css';
import axios from 'axios'
import store from './store'
import './axios'  // 引入自定义的 axios 配置文件
import '/node_modules/github-markdown-css/github-markdown.css';
import { mavonEditor } from 'mavon-editor';
import 'mavon-editor/dist/css/index.css';
import ECharts from 'vue-echarts'
import { use } from "echarts/core"

// 手动引入 ECharts 模块来减小打包体积
import {
    CanvasRenderer
} from 'echarts/renderers'
import {
    LineChart,
    BarChart,
    PieChart
} from 'echarts/charts'
import {
    GridComponent,
    TooltipComponent,
    LegendComponent,
    TitleComponent
} from 'echarts/components'

use([
    CanvasRenderer,
    LineChart,
    BarChart,
    PieChart,
    GridComponent,
    TooltipComponent,
    LegendComponent,
    TitleComponent
])
const app = createApp(App)
app.use(ElementPlus)
app.use(router)
app.use(store);
// 全局注册组件（可选）
app.component('v-chart', ECharts)
app.component('mavon-editor', mavonEditor);

app.config.globalProperties.$axios = axios;
//axios.defaults.baseURL = "http://localhost:8081"
//app.use(axios)

app.mount('#app')
